package ZuoYe02_FangFa_0429;

import java.util.Scanner;

//5:Circle圆的属性有半径和坐标(x,y轴），要求添加方法，
//计算圆的面积和周长（返回值的方式）。

public class Circle {
	static double r;
	double x;
	double y;

	public double mianJi(double r) {
		double mianJi = 3.14 * r * r;
		return mianJi;
	}

	public double zhouChang(double r) {
		double zhouChang = 3.14 * r * 2;
		return zhouChang;
	}

	public static void main(String[] args) {

		System.out.print("请输入圆的半径：");
		Scanner input = new Scanner(System.in);
		Circle a = new Circle();
		a.r = input.nextDouble();
		a.mianJi(r);
		System.out.println("半径为：" + r + "的圆，其面积为：" + a.mianJi(r));
		a.zhouChang(r);
		System.out.println("半径为：" + r + "的圆，其周长为：" + a.zhouChang(r));
	}
}
